package com.linsir.lin.controller.omp;

import com.linsir.lin.dto.GridDTO;
import com.linsir.lin.dto.MemberDTO;
import com.linsir.lin.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.InvocationTargetException;

/**
 * @author ：linsir
 * @date ：Created in 2021/7/9 15:46
 * @description：组织成员
 * @modified By：
 * @version: 1.0.0
 */
@RestController
@RequestMapping(value = "/member/")
public class MemberController {

    @Autowired
    private MemberService memberService;



    @RequestMapping(value = "grid",method = {RequestMethod.GET,RequestMethod.POST})
    public GridDTO<MemberDTO> grid() throws InvocationTargetException, IllegalAccessException {
           return memberService.grid();
    }

    @RequestMapping(value = "/organ/grid/{organId}",method = {RequestMethod.GET,RequestMethod.POST})
    public GridDTO<MemberDTO> grid(@PathVariable("organId") Integer organId) throws InvocationTargetException, IllegalAccessException {
        return memberService.grid(organId);
    }
}
